﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="TelaCadastroProdutos.aspx.cs" Inherits="DMA.SGDB.Web.TelaCadastroProdutos"  %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <%@ Register TagPrefix="ucpnlQuestion" TagName="question" Src="~/Shared/UserControl/PainelYesNoUserControl.ascx" %>
    <%@ Register TagPrefix="ucpnlError" TagName="errors" Src="~/Shared/UserControl/PainelErrosUserControl.ascx" %>
    <%@ Register TagPrefix="ucNumericTextBox" TagName="numeric" Src="~/Shared/UserControl/NumericTextBoxUserControl.ascx" %>

    <script type="text/javascript" language="javascript">
        function isNumberKey(evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;

            return true;
        }
</script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
      
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <ucpnlError:errors  runat="server" ID="pnlErros"/>
            <ucpnlQuestion:question runat="server" ID="pnlQuestion"></ucpnlQuestion:question>
            <div class="toolbarContanneir">
                <div id="divBtnNew" class="Toolbarbutton" runat="server">
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Imagens/Adicionar.png" ToolTip="Adicionar Cliente" OnClick="imgBtnNew_Click" />
                </div>
                <div id="divBtnSave" class="Toolbarbutton" runat="server">
                    <asp:ImageButton ID="imgBtnSave" runat="server" ImageUrl="~/Imagens/Salvar.png" OnClick="imgBtnSave_Click" ToolTip="Salvar" />
                </div>
                <div id="divBtnCancel" class="Toolbarbutton" runat="server">
                    <asp:ImageButton ID="imgBtnCancel" runat="server" ImageUrl="~/Imagens/Cancelar.png" OnClick="imgBtnCancel_Click" ToolTip="Cancelar" />
                </div>
                <div id="divBtnBack" class="Toolbarbutton" runat="server" visible="false" >
                    <asp:ImageButton ID="imgBtnBack" runat="server" ImageUrl="~/Imagens/Back.png" OnClick="imgBtnCancel_Click" Visible="true" ToolTip="Voltar" />
                </div>
            </div> 
            <asp:Panel ID="pnlList" runat="server">
                <div class="grupo" style="margin-top:5px">
                     <asp:GridView ID="gvList" runat="server" Width="820px" CellPadding="4" ForeColor="#333333" EnableSortingAndPagingCallbacks="True" 
                        AllowPaging="True" AllowSorting="True" onpageindexchanging="gvList_PageIndexChanging" onsorting="gvList_Sorting">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <div style="width:100px; margin:2px">
                                        <asp:ImageButton ID="imgBtnEdit" runat="server" ImageUrl="~/Imagens/Alterar.gif" OnClick="imgBtnEdit_Click" ToolTip="Editar Configurações" />
                                        <asp:ImageButton ID="imgBtnDelete" runat="server" ImageUrl="~/Imagens/DeleteGrid.png" OnClick="imgBtnDelete_Click" ToolTip="Excluir Cadastro" />
                                        <asp:ImageButton ID="imgBtnVisualize" runat="server" ImageUrl="~/Imagens/ViewGrid.png" OnClick="imgBtnVisualize_Click" ToolTip="Visualizar Configurações" />                                      
                                    </div>
                                </ItemTemplate>
                                <ControlStyle Width="20px" />
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" 
                            HorizontalAlign="Center" />
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" 
                            Font-Size="Large" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                       
                </div>
            </asp:Panel>
            <asp:Panel ID="pnlRegister" runat="server" visible="false"> 
                <div style="font-size:16px; font-weight:bold; padding-bottom:10px; margin-top:5px"><asp:Label ID="lblTitle" runat="server" Text="Cadastro de Produtos"></asp:Label></div>    
                <div>
                    <table id="Table1" runat="server">
                        <tr id="nome">
                            <td>
                                <asp:Label ID="lblName" runat="server" Text="Nome:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtName" runat="server" MaxLength="30"></asp:TextBox>
                            </td>
                        </tr>
                        <tr id="PreçoDeCusto">
                            <td>
                                <asp:Label ID="lblCostPrice" runat="server" Text="Preço de custo (R$):"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtCostPrice" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr id="Lucro">
                            <td>
                                <asp:Label ID="lblGain" runat="server" Text="Lucro pretendido (%):"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtGain" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Button ID="btncalcular" runat="server" AutoPostBack="true" Text="Calcular" 
                                    onclick="btnCalcular_Click"/>
                            </td>
                        </tr>
                        <tr id="Descricao">
                            <td>
                                <asp:Label ID="lblDescricao" runat="server" Text="Descrição:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtDescricao" runat="server" MaxLength="70"></asp:TextBox>
                            </td>
                        </tr>
                        <tr id="Unidade">
                            <td>
                                <asp:Label ID="lblUnidade" runat="server" Text="Unidade:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtUnidade" runat="server" MaxLength="4"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblQuantConteudo" runat="server" Text="Quant. conteúdo:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtQuantConteudo" runat="server" MaxLength="4"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblQuantEstoque" runat="server" Text="Quant. estoque:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtQuantEstoque" runat="server" MaxLength="3"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblPrecoVenda" runat="server" Text="Preço de venda (R$):"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtPrecoVenda" runat="server" Enabled="false"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblEstoqueMin" runat="server" Text="Estoque Mínimo:"></asp:Label>
                            </td>
                            <td>                            
                                <asp:TextBox ID="txtEstoqueMin" runat="server" MaxLength="3"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>